import request from './request'

// 创建订单
export function createOrder(data: {
  userId: number;
  roomID: number;
  checkInDate: string;
  checkOutDate: string;
}) {
  return request({
    url: '/orders',
    method: 'post',
    data
  })
}

// 获取订单详情
export function getOrderDetail(id: string) {
  return request({
    url: `/orders/${id}`,
    method: 'get'
  })
}

// 更新订单
export function updateOrder(id: string, data: any) {
  return request({
    url: `/orders/${id}`,
    method: 'put',
    data
  })
}

// 删除订单
export function deleteOrder(id: string) {
  return request({
    url: `/orders/${id}`,
    method: 'delete'
  })
}

// 获取所有订单
export function getOrderList() {
  return request({
    url: '/orders',
    method: 'get'
  })
} 